﻿#include <stdio.h>
#define N 5
void fun(int a[N][N])
{
	int i,j,k,t;
	for(i=0;i<N;i++)   
	{
		/**********found**********/
		k=0;
		for(j=1;j<N;j++)
		/**********found**********/
			if(a[i][j]>a[i][k])
				k=j;
		t=a[i][0];
		a[i][0]=a[i][k];  
		/**********found**********/
		a[i][k] =t;   
	}
}
main()
{
	int i,j;
	int a[N][N]={{51,27,44,50,99},
	             {74,58,28,62,84},
				 {45,75,71,97,76},
				 {51,35,72,67,46},
				 {91,34,42,73,32}};
	fun(a);
	for(i=0;i<N;i++)
	{
		for(j=0;j<N;j++)
			printf("%3d",a[i][j]);
		printf("\n");
	}
 }
